Skip to content

Conversation

StuCM
Copy link
Contributor

@StuCM StuCM commented Sep 11, 2025

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

This PR adds the ability to provide configuration for individual widgets within a workflow by passing config options for the workflow directly in the workflow file.
This allows for different options to be applied to a node/widget in a workflow without editing the graph and affecting various workflows that may not need the applied config. For example disabling input or making adjustments to the label or placeholder string.
It modifies the card-component.js to take the input config and process this to overwrite the matching params that are passed to the widget on render.
This is done through a series of handlers to create the correct data type depending on the param that is being overwritten.

An app has been setup with a workflow and models to test the functionality.

https://github.com/flaxandteal/arches_example.git

Follow the install instructions for the app and then in the create-movie-workflow.js some configuration options have been set for a node that can be adjusted.

The idea is that you add a nodeOptions param. Within that you set a key as the node to adjust and then you can overwrite the configs within that.

nodeOptions: {
    '6d5fc3d0-44a5-4f20-80b8-86bb42818eee': {
        disabled: true,
        allowInstanceCreation: false,
        widget: {
            visible: true
        },
        config: {
            label: "I have changed!",
            placeholder: "This is my new placeholder"
        },
        node: {
            isrequired: true
        }
    }
}

Issues Solved

This is a new feature that we have been using to allow us to use the same node and apply different configurations to the widget dependent upon the workflow being used.

Checklist

  • I targeted one of these branches:
    • dev/8.1.x (under development): features, bugfixes not covered below
    • dev/8.0.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/7.6.x (extended support): major security issues, data loss issues
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Ticket Background

  • Sponsored by:
  • Found by: @
  • Tested by: @
  • Designed by: @

Further comments

@StuCM StuCM marked this pull request as ready for review September 16, 2025 11:33
@chiatt chiatt self-requested a review September 19, 2025 00:02
@chiatt chiatt self-assigned this Sep 19, 2025
Copy link
Member

@chiatt chiatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very helpful feature, but I noticed an issue with required nodes. When I changed a required node to isrequired: false, it appeared in the card without the asterisk I'd expect, but when I saved the step, I got an error.

image

const options = params.nodeOptions?.[nodeId] || {};
const nodeOptions = {};

if (!options) return;
Copy link
Member

@chiatt chiatt Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove this line because it doesn't look like return is ever reachable. In line 320, options is always a value or an object literal which isn't falsy.

@chiatt chiatt requested a review from chrabyrd September 19, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants